﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using DXApplicationTangche.UC.样品管理.样品下单新.service;

namespace DXApplicationTangche.UC.样品管理.样品下单
{
    public partial class Form创建委外客户 : DevExpress.XtraEditors.XtraForm
    {
        public Form创建委外客户()
        {
            InitializeComponent();
        }

        private void simpleButton确认_Click(object sender, EventArgs e)
        {
            if (String.IsNullOrWhiteSpace(this.textBox客户名.Text)
                    || String.IsNullOrWhiteSpace(this.textBox电话.Text)
                                        )
            {
                MessageBox.Show("请填写信息完全");
                return;
            }
            DialogResult dr = MessageBox.Show("确定信息？", "提示:确认", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
            if (dr == DialogResult.OK)
            {
                try
                {
                    CustomerChooseInfoDTO CustomerChooseInfoDTO = 
                        样品下单Service.createCustomer(
                            new CustomerCreateDTO(
                                this.textBox客户名.Text.Trim(), 
                                this.textBox电话.Text.Trim()
                                )
                            );
                }
                catch
                {
                    MessageBox.Show("创建失败");
                }
            }
            this.Close();
        }
    }
}